<script>
	import util from "utils/util.js";
	export default {
		onLaunch: function() {
			console.log('App Launch')
			// #ifdef APP-PLUS
			/* 5+ 环境锁定屏幕方向 */
			plus.screen.lockOrientation('portrait-primary'); //  锁定
			const userCID = util.getStorage('userCID')
			if (!userCID) {
				const info = plus.push.getClientInfo()
				console.log(info.clientid)
				util.setStorage('userCID', info.clientid)
			}
			console.log(userCID)
			// #endif

			uni.getProvider({ // 获取推送提供商
				service: 'push',
				success(res) {
					if (~res.provider.indexOf('igexin')) {
						uni.subscribePush({ // 开启推送
							provider: 'igexin',
							success(res) {
								
							}
						});
						uni.onPush({
							provider: 'igexin',
							success: function() {
									
							},
							callback: function(data) {
								util.tost('您有一个新的任务')
							}
						})
					}
				}
			})



		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	page {
		font-size: 32upx;
	}

	/*每个页面公共css */
	.bottom-bow {
		position: fixed;
		width: 100%;
		bottom: -1upx;
		height: 1upx;
		box-shadow: 0 -1upx 7upx rgba(0, 0, 0, 0.2);
		z-index: 1000;
	}
</style>
